package com.bsoft.gol.hcs.enumcase;

/**
 * @author tongtp
 * @version v0.1
 * @package enumcase
 * @className ConditionFilterMethodEnum
 * @description
 * @create 2021-08-11 9:42
 **/
public enum ConditionFilterMethodEnum {

	//条件筛选方法：1 范围(包含边界) 2 等于 3 大于 4 小于 5 大于等于 6 小于等于，7包含，8不包含 9 Between
	SCOPE((byte) 1, "范围(包含边界)"),
	EQUAL((byte) 2, "等于"),
	GREATER_THAN((byte) 3, "大于"),
	LESS_THAN((byte) 4, "小于"),
	GREATER_THAN_OR_EQUAL((byte) 5, "大于等于"),
	LESS_THAN_OR_EQUAL((byte) 6, "小于等于"),
	CONTAIN((byte) 7, "包含"),
	NOT_INCLUDED((byte) 8, "不包含"),
	BETWEEN((byte) 9, "Between");

	private final Byte type;

	private final String name;

	ConditionFilterMethodEnum(Byte type, String name) {
		this.type = type;
		this.name = name;
	}

	public static ConditionFilterMethodEnum getEnumByKey(Byte type) {
		for (ConditionFilterMethodEnum temp : ConditionFilterMethodEnum.values()) {
			if (temp.getType().equals(type)) {
				return temp;
			}
		}
		return null;
	}

	public Byte getType() {
		return type;
	}

	public String getName() {
		return name;
	}
}
